<div id="inputLedger">
    <!--页面调整-->
    <el-row v-loading="showLoading"
            element-loading-text="拼命加载中">
        <el-col :span="24">
            <div class="inner btn-nav">
                <el-input
                        @change="selectReturn"
                        class="input"
                        v-model="dbdh"
                        icon="search"
                        placeholder="调拨单号"></el-input>
                <el-input
                        @change="selectReturn"
                        class="input"
                        v-model="dh"
                        icon="search"
                        placeholder="单号"></el-input>
                <el-date-picker
                        v-model="date1"
                        type="daterange"
                        align="right"
                        placeholder="到货日期"
                        class="datePicker"
                        :picker-options="pickerOptions">
                </el-date-picker>
                <el-select
                        @visible-change="selectReturn"
                        v-model="rkArehouseId"
                        placeholder="请选择所属仓库">
                    <el-option :label="obj.baName" :value="obj.baArehouseId"
                               v-for="obj of baseArehouses"></el-option>
                </el-select>
                <button @click="dialogSelectVisible=!dialogSelectVisible" class="btn btn-search"><i
                        class="icon search"></i><span>详细查询</span>
                </button>
                <button @click="multiSelectClick" class="btn btn-multiSelect">
                    <i class="icon sel"></i>
                    <span>多选</span>
                </button>
                <button
                        style="position: absolute;top: -2.59px;"
                        class="btn btn-distribution"
                        @click="moreOperationModify"
                        v-show="multiSelect">
                    <span>导出</span>
                </button>
            </div>
            <el-table
                    :data="inputLedger"
                    :default-sort="{prop: 'sjsj', order: 'descending'}"
                    :max-height="config_table_height()"
                    @toggleRowSelection="rowSelection"
                    @row-click="hello"
                    @expand="expandChange"
                    @selection-change="handleSelectionChange"
                    ref="table"
                    class="inputLedgerTable"
                    style="width: 100%">
                <el-table-column
                        type="expand">
                    <template scope="props">
                        <el-row>
                            <h3 style="margin-top: 0; margin-left: -15px;">入库台账详细</h3>
                        </el-row>
                        <el-form label-position="left" inline class="demo-table-expand">
                            <el-row>
                                <el-col :span="11">
                                    <el-form-item label="始发日期">
                                        <el-icon name="time"></el-icon>
                                        <span style="margin-left: 10px">{{ auto_time_new(props.row['sfrq'],6) }}</span>
                                    </el-form-item>
                                    <el-form-item label="调拨地点">
                                        <span>{{ props.row.dbdd }}</span>
                                    </el-form-item>
                                    <el-form-item label="承运商">
                                        <span>{{ props.row.cys }}</span>
                                    </el-form-item>
                                    </el-form-item>
                                    <el-form-item label="车牌号">
                                        <span>{{ props.row.cph }}</span>
                                    </el-form-item>
                                    <el-form-item label="收货人">
                                        <span>{{ props.row.shr }}</span>
                                    </el-form-item>
                                    <el-form-item label="收货仓库">
                                        <el-tag type="success">
                                            {{ props.row.shck }}
                                        </el-tag>
                                    </el-form-item>
                                    <el-form-item label="单号">
                                        <el-tag type="primary">
                                            {{ props.row.dh }}
                                        </el-tag>
                                    </el-form-item>
                                    <el-form-item label="调拨单号">
                                        <span>{{ props.row.dbdh }}</span>
                                    </el-form-item>
                                    <el-form-item label="承运台数">
                                        <span>{{ props.row.cyts }}</span>
                                    </el-form-item>
                                    <el-form-item label="承运件数">
                                        <span>{{ props.row.cyxs }}</span>
                                    </el-form-item>
                                    <el-form-item label="预计方数">
                                        <span>{{ props.row.cytj }}</span>
                                    </el-form-item>

                                    <el-form-item label="物料编码">
                                        <span>{{ props.row.wlbm }}</span>
                                    </el-form-item>
                                    <el-form-item label="物料描述">
                                        <span>{{ props.row.wlms }}</span>
                                    </el-form-item>
                                    <el-form-item label="台数">
                                        <span>{{ props.row.ts }}</span>
                                    </el-form-item>

                                </el-col>
                                <el-col :span="11" :offset="2">
                                    <el-form-item label="件数">
                                        <span>{{ props.row.js }}</span>
                                    </el-form-item>
                                    <el-form-item label="实发方数">
                                        <span>{{ props.row.tj }}</span>
                                    </el-form-item>
                                    <el-form-item label="到货日期">
                                        <el-icon name="time"></el-icon>
                                        <span style="margin-left: 10px">{{auto_time_new(props.row.dhsj,6)  }}</span>
                                    </el-form-item>
                                    <el-form-item label="收货日期">
                                        <el-icon name="time"></el-icon>
                                        <span style="margin-left: 10px">{{ auto_time_new(props.row.dhsj,6) }}</span>
                                    </el-form-item>
                                    <el-form-item label="破损/台数">
                                        <span>{{ props.row.psts }}</span>
                                    </el-form-item>
                                    <el-form-item label="破损外包(调)">
                                        <span>{{ props.row.dbpswb }}</span>
                                    </el-form-item>
                                    <el-form-item label="破损外包(源)">
                                        <span>{{ props.row.ytpswb }}</span>
                                    </el-form-item>
                                    <el-form-item label="破损内保(调)">
                                        <span>{{ props.row.dbpsnb }}</span>
                                    </el-form-item>
                                    <el-form-item label="破损内保(源)">
                                        <span>{{ props.row. ytpsnb }}</span>
                                    </el-form-item>
                                    <el-form-item label="泡沫">
                                        <span>{{ props.row.pm }}</span>
                                    </el-form-item>
                                    <el-form-item label="缺机/台">
                                        <span>{{ props.row.qhsl }}</span>
                                    </el-form-item>
                                    <el-form-item label="异常原因">
                                        <span>{{ props.row.ycyy }}</span>
                                    </el-form-item>
                                    <el-form-item label="处理结果">
                                        <span>{{ props.row.cljg }}</span>
                                    </el-form-item>
                                    <el-form-item label="结算时间">
                                        <el-icon name="time"></el-icon>
                                        <span style="margin-left: 10px">{{ auto_time_new(props.row.jssj,1) }}</span>
                                    </el-form-item>
                                    <el-form-item label="可用操作">
                                        <el-button
                                                size="small"
                                                type="success"
                                                @click="inlineExport(props.$index, props.row)">导出
                                        </el-button>
                                        <el-button
                                                size="small"
                                                v-if="props.row.qhsl!=0"
                                                @click="inlineOweEnd(props.$index, props.row)">欠货完结
                                        </el-button>
                                        <el-button
                                                size="small"
                                                @click="inlineProductionLedger(props.$index, props.row)">制作台账
                                        </el-button>

                                    </el-form-item>
                                    <el-form-item label="备注">
                                        <el-tooltip class="item" effect="dark" :content="props.row.remarks"
                                                    placement="top">
                                            <span class="remark">{{ props.row.remarks }}</span>
                                        </el-tooltip>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-form>
                    </template>
                </el-table-column>
                <el-table-column
                        label="单号"
                        show-overflow-tooltip
                        align="center"
                        prop="dh">
                </el-table-column>
                <el-table-column
                        label="任务号"
                        show-overflow-tooltip
                        align="center"
                        prop="rkrwNo">
                </el-table-column>
                <el-table-column
                        label="到货日期"
                        width="120"
                        show-overflow-tooltip
                        align="center">
                    <template scope="scope">
                        {{auto_time_new(scope.row.dhsj)}}
                    </template>
                </el-table-column>
                <el-table-column
                        label="收货日期"
                        width="120"
                        show-overflow-tooltip
                        align="center">
                    <template scope="scope">
                        {{auto_time_new(scope.row.dhsj)}}
                    </template>
                </el-table-column>
                <el-table-column
                        label="调拨地点"
                        width="150"
                        show-overflow-tooltip
                        align="center"
                        prop="dbdd">
                </el-table-column>
                <el-table-column
                        label="承运商"
                        width="120"
                        show-overflow-tooltip
                        align="center"
                        prop="cys">
                </el-table-column>
                <el-table-columneng
                        label="车牌号"
                        width="100"
                        show-overflow-tooltip
                        align="center"
                        prop="cph">
                </el-table-columneng>
                <el-table-column
                        label="收货人"
                        show-overflow-tooltip
                        align="center"
                        prop="shr">
                </el-table-column>
                <el-table-column
                        v-if="multiSelect"
                        type="selection"
                        width="60">
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[5, 10, 15, 20, 100, 500, 1000, 5000, 10000]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="currentTotal">
                </el-pagination>
            </div>
        </el-col>
    </el-row>
    <el-dialog
            size="large"
            v-model="dialogSelectVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">详细查询</span>
        </div>
        <el-row>
            <el-col :span="8">
                <el-form :model="form">
                    <el-form-item label="始发日期"
                                  :label-width="formLabelWidth">
                        <el-date-picker
                                v-model="form.sfrq"
                                type="daterange"
                                align="right"
                                placeholder="始发日期"
                                class="input"
                                :picker-options="pickerOptions">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="到货日期"
                                  :label-width="formLabelWidth">
                        <el-date-picker
                                v-model="form.dhrq"
                                type="daterange"
                                align="right"
                                placeholder="到货日期"
                                class="input"
                                :picker-options="pickerOptions">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="收货日期"
                                  :label-width="formLabelWidth">
                        <el-date-picker
                                v-model="form.shrq"
                                type="daterange"
                                align="right"
                                placeholder="收货日期"
                                class="input"
                                :picker-options="pickerOptions">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="调拨单号"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.dbdh"
                                icon="search"
                                placeholder="调拨单号"></el-input>
                    </el-form-item>
                    <el-form-item label="调拨地"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.dbdd"
                                icon="search"
                                placeholder="调拨地"></el-input>
                    </el-form-item>
                </el-form>
            </el-col>
            <el-col :span="10" :offset="2">
                <el-form :model="form">
                    <el-form-item label="车牌号"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.cph"
                                icon="search"
                                placeholder="车牌号"></el-input>
                    </el-form-item>
                    <el-form-item label="收货人"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.shr_"
                                icon="search"
                                placeholder="收货人"></el-input>
                    </el-form-item>
                    <el-form-item label="收货仓库"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.shck"
                                icon="search"
                                placeholder="收货仓库"></el-input>
                    </el-form-item>
                    <el-form-item label="物料编号"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.wlbm"
                                icon="search"
                                placeholder="物料编号"></el-input>
                    </el-form-item>
                    <el-form-item label="物料描述"
                                  :label-width="formLabelWidth">
                        <el-input
                                class="input"
                                v-model="form.wlms"
                                icon="search"
                                placeholder="物料描述"></el-input>
                    </el-form-item>
                </el-form>
            </el-col>
        </el-row>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="form = _form()">重置</el-button>
            <el-button type="primary" @click="selectSubmit" :loading="selectLoading">查询</el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="tiny"
            title="欠货完结信息"
            custom-class="end"
            v-model="dialogEndVisible">
        <el-form
                ref="ref_end"
                :rules="rule_end"
                :model="end">
            <el-form-item
                    label="完结原因"
                    prop="rksWjReason"
                    :label-width="formLabelWidth">
                <el-input
                        v-model="end.rksWjReason"
                        auto-complete="off"></el-input>
            </el-form-item>
            <el-form-item
                    label="补发单号"
                    prop="rksBfdh"
                    :label-width="formLabelWidth">
                <el-input
                        v-model="end.rksBfdh"
                        auto-complete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="endSubmit" :loading="submitLoading">保存
            </el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="full"
            title="制作台账信息"
            custom-class="ledger"
            :label-width="formLabelWidth"
            v-model="dialogLedgerVisible">
        <el-form
                :model="ledger">
            <el-row>
                <el-col :span="5">
                    <el-form-item
                            label="始发日期"
                            :label-width="formLabelWidth">
                        {{auto_time_new(ledger.sfrq)}}
                    </el-form-item>
                    <el-form-item
                            label="到货日期"
                            :label-width="formLabelWidth">
                        {{auto_time_new(ledger.dhsj)}}
                    </el-form-item>
                    <el-form-item
                            label="收货日期"
                            :label-width="formLabelWidth">
                        {{auto_time_new(ledger.dhsj)}}
                    </el-form-item>
                    <el-form-item
                            label="调拨地点"
                            :label-width="formLabelWidth">
                        {{ledger.dbdd}}
                    </el-form-item>
                    <el-form-item
                            label="承运商"
                            :label-width="formLabelWidth">
                        {{ledger.cys}}
                    </el-form-item>
                    <el-form-item
                            label="车牌号"
                            :label-width="formLabelWidth">
                        {{ledger.cph}}
                    </el-form-item>
                    <el-form-item
                            label="收货人"
                            :label-width="formLabelWidth">
                        {{ledger.shr}}
                    </el-form-item>
                    <el-form-item
                            label="收货仓库"
                            :label-width="formLabelWidth">
                        {{ledger.shck}}
                    </el-form-item>
                    <el-form-item
                            label="单号"
                            :label-width="formLabelWidth">
                        {{ledger.dh}}
                    </el-form-item>
                    <el-form-item
                            label="调拨单号"
                            :label-width="formLabelWidth">
                        {{ledger.dbdh}}
                    </el-form-item>
                </el-col>
                <el-col :span="8" :offset="2">
                    <el-form-item
                            label="承运件数(台)"
                            :label-width="formLabelWidth">
                        {{ledger.cyts}}
                    </el-form-item>
                    <el-form-item
                            label="承运件数(箱)"
                            :label-width="formLabelWidth">
                        {{ledger.cyxs}}
                    </el-form-item>
                    <el-form-item
                            label="方数"
                            :label-width="formLabelWidth">
                        {{ledger.cytj}}
                    </el-form-item>
                    <el-form-item
                            label="物料编号"
                            :label-width="formLabelWidth">
                        {{ledger.wlbm}}
                    </el-form-item>
                    <el-form-item
                            label="物料描述"
                            :label-width="formLabelWidth">
                        {{ledger.wlms}}
                    </el-form-item>
                    <el-form-item
                            label="台数"
                            :label-width="formLabelWidth">
                        {{ledger.ts}}
                    </el-form-item>
                    <el-form-item
                            label="件数"
                            :label-width="formLabelWidth">
                        {{ledger.js}}
                    </el-form-item>
                    <el-form-item
                            label="方数"
                            :label-width="formLabelWidth">
                        {{ledger.tj}}
                    </el-form-item>
                </el-col>
                <el-col :span="6" :offset="1">
                    <el-form-item
                            label="泡沫"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.pm"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="调拨破损外包"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.dbpswb"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="源头破损外包"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.ytpswb"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="调拨破损内保"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.dbpsnb"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="源头破损内保"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger. ytpsnb"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="缺机/台"
                            :label-width="formLabelWidth">
                        <el-input
                                :disabled="true"
                                v-model.number="ledger.qhsl"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="异常原因"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.ycyy"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="处理结果"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.cljg"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item
                            label="破损台数"
                            :label-width="formLabelWidth">
                        <el-input
                                v-model.number="ledger.psts"
                                auto-complete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="结算时间" :label-width="formLabelWidth">
                        <el-date-picker
                                v-model="ledger.jssj"
                                type="datetime"
                                placeholder="选择结算时间">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>

        </el-form>
        <div slot="footer">
            <el-button type="primary" @click="ledgerSubmit" :loading="submitLoading">保存
            </el-button>
        </div>
    </el-dialog>
</div>
<link rel="stylesheet" href="index.scss">
<script src="index.js"></script>
